<div class="container">
  <div class="row row-cards row-deck mt-md-5">

    <div class="col-md-12">
      <a href="<%= Routes.page_path(@conn, :new) %>" class="btn btn-primary mr-auto">
        <i class="fe fe-plus mr-1"></i>
        <%= gettext "New page" %></a>
    </div>
    
    <div class="col-md-12 mt-5">
      <div class="card" style="flex-grow: 0;">
        <div class="table-responsive">
          <table class="table table-hover table-outline table-vcenter text-nowrap card-table">
            <thead>
              <tr>
                <th ><%= gettext "Title" %></th>
                <th class="w-0"><%= gettext "Status" %></th>
                <th class="w-0"><%= gettext "Actions" %></th>
              </tr>
            </thead>
            <tbody>

              <%= for page <- @pages do %>
                <tr>
                  <td>
                    <a href="<%= Routes.page_path(@conn, :show, page) %>" class="fw-bold d-block"><%= page.title %></a>
                    <a href="<%= Routes.page_path(@conn, :show, page) %>" class="small text-muted"><%= Routes.page_path(@conn, :show, page) %></a>
                  </td>

                  <td class="text-center">
                    <%= if page.draft do %>
                      <span class="badge badge-pill badge-secondary"><%= gettext "Draft" %></span>
                    <% else %>
                      <span class="badge badge-pill badge-success"><%= gettext "Published" %></span>
                    <% end %>
                  </td>

                  <td class="text-center">
                    <a href="<%= Routes.page_path(@conn, :edit, page) %>" class="btn btn-secondary btn-sm"><i class="fe fe-edit-2"></i> Edit</a>
                    <%= link to: Routes.page_path(@conn, :delete, page), class: "btn btn-danger btn-sm", method: "delete", data: [confirm: gettext("Are you sure?")] do %>
                      <i class="fe fe-x"></i> <%= gettext "Delete" %></a>
                    <% end %>

                    
                  </td>
                </tr>
              <% end %>

            </tbody>
          </table>

        </div>
      </div>

      <%= component "pagination.html", assigns %>

    </div>

  </div>
</div>




